package global;

import java.io.PrintWriter;
import java.io.StringWriter;

public class BaseException extends Exception{

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -3791243372909483919L;
	
	/**
	 * 构造方法
	 */
	public BaseException() {
		super();
	}
	
	/**
	 * 构造方法
	 */
	public BaseException(Throwable cause) {
		super(cause);
	}
	
	
	/**
	 * 返回一个错误信息的执行路径信息
	 * 
	 * @param cause Throwable
	 * @return
	 */
	public static String getExceptionStackTrace(Throwable cause){
		StringWriter sw = new StringWriter();
		PrintWriter pw = new PrintWriter(sw);
		cause.printStackTrace(pw);
		return sw.toString();
	}
}
